<?php 
$params = Yii::app()->controller->getActionParams();
if (!empty($params)) {
    foreach($params as $key => $value) {
        if ($key == 'lang')
            $langParam = $value;
    }
}
?>

<?php
$url = "./index.php?r=search/";
if(!Yii::app()->user->isGuest)
    $url .= "index2";
else
    $url .= "index1";

if (!empty($langParam)) $url .= "&lang=".$langParam;
?>

<?php echo CHtml::beginForm($url, 'get'); ?>
<div id="templatemo_search">
    <div class="sidebar_box"><span class="bottom"></span>
        <h3><?php echo Yii::t('translation', 'AdvanceSearch') ?></h3>
        <div class="content">
            <input value="<?php echo Yii::t('translation', 'Keyword') ?>" type="text"  name="keyword" id="keyword" title="keyword" onfocus="clearText(this)" onblur="clearText(this)" class="txt_field2" /> <br/>
        </div>
        <div class="content">
            <input value="<?php echo Yii::t('translation', 'PriceFrom') ?>" type="text"  name="from" id="from" title="from" onfocus="clearText(this)" onblur="clearText(this)" class="txt_field2" /> <br/>
        </div>
        <div class="content">
            <input value="<?php echo Yii::t('translation', 'To') ?>" type="text"  name="to" id="to" title="to" onfocus="clearText(this)" onblur="clearText(this)" class="txt_field2" /> <br/>
        </div>
        <br/>
        <div class="content">
            <button type="submit" name="Search" value="1" alt="Search" id="searchbutton" title="Search" class="sub_btn2"  ><?php echo Yii::t('translation', 'Look') ?></button>
        </div>
        <div class="content"></div>
        <div class="content"></div>
        <div class="content"></div>
    </div>
</div>
<?php echo CHtml::endForm();?>